package com.wangge.proxy.interfaceCase2;

import java.util.HashMap;
import java.util.Map;

/**
 * 貌似成策略模式了<br/>
 * date: 2016年11月10日 上午9:51:40 <br/> 
 * @author yangqc
 * @version
 * @since JDK 1.8
 */
public class WaiterProxy {
  Map<String, Waiter> waiterMap = new HashMap<>();
  {
    waiterMap.put("restaurant", new RestaurantWaiter());
    waiterMap.put("hotel", new HotelWaiter());
  }
  
  public void doService(String place, int sum) {
    Waiter waiter = waiterMap.get(place);
    waiter.service(sum);
  }
  
  public static void main(String[] args) {
    WaiterProxy proxy = new WaiterProxy();
    proxy.doService("restaurant", 20);
    
  }
}
